<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title></title>
</head>

<body>
    <div id="div1">
        滑入

    </div>
</body>
<script>
    window.onload = function () {
        var a1 = document.getElementById("div1");
        a1.onmouseover = function () {
            a1.className = "hover"
        };
        a1.onmouseout = function () {
            a1.className = ""
        }
    };
</script>

</html>
<style>
    #div1 {
        width: 150px;
        height: 150px;
        margin: 0 auto;
        padding: 10px;
        background: pink;
        border: 1px solid #000;

    }

    #div1.hover {
        color: pink;
        background: #f0f0f0;
        border: 1px solid;
    }
</style>